package com.googlecode.gunncs.event;

import com.googlecode.gunncs.sensor.RangeFinder;

/**
 * A RangefinderEvent encapsulates ranging data
 * 
 * @author ajc
 * 
 */
public class RangeFinderEvent {

	// TODO time, id,

	private final RangeFinder r;
	private final double theta;
	private final double distance;
	private final int id;

	public RangeFinderEvent(RangeFinder r, int id, double theta, double distance) {
		this.r = r;
		this.id = id;
		this.theta = theta;
		this.distance = distance;
	}

	public double getTheta() {
		return theta;
	}

	public double getDistance() {
		return distance;
	}

	public RangeFinder getSource() {
		return r;
	}

	public int getId() {
		return id;
	}

	public String toString() {
		return r + ":" + id + " at angle " + theta + ", distance " + distance;
	}

}
